package com.health.medicine.model.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;

/**
 * 药品信息表
 * @TableName medicine_info
 */
@TableName(value ="medicine_info")
@Data
public class MedicineInfo implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 药品名称
     */
    private String drugName;

    /**
     * 药品类型
     */
    private Integer drugType;

    /**
     * 药品剂型
     */
    private String drugForm;

    /**
     * 药品规格
     */
    private String drugSpec;

    /**
     * 药品单位
     */
    private String drugUnit;

    /**
     * 药品生产厂家ID
     */
    private Long manufacturerId;

    /**
     * 过期时间
     */
    private LocalDateTime expireTime;

    /**
     * 生产时间
     */
    private LocalDateTime produceTime;

    /**
     * 收货地址
     */
    private String receiverAddress;

    /**
     * 逻辑删除标志，1表示已删除
     */
    @TableLogic
    private Integer isDelete;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MedicineInfo other = (MedicineInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDrugName() == null ? other.getDrugName() == null : this.getDrugName().equals(other.getDrugName()))
            && (this.getDrugType() == null ? other.getDrugType() == null : this.getDrugType().equals(other.getDrugType()))
            && (this.getDrugForm() == null ? other.getDrugForm() == null : this.getDrugForm().equals(other.getDrugForm()))
            && (this.getDrugSpec() == null ? other.getDrugSpec() == null : this.getDrugSpec().equals(other.getDrugSpec()))
            && (this.getDrugUnit() == null ? other.getDrugUnit() == null : this.getDrugUnit().equals(other.getDrugUnit()))
            && (this.getManufacturerId() == null ? other.getManufacturerId() == null : this.getManufacturerId().equals(other.getManufacturerId()))
            && (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
            && (this.getProduceTime() == null ? other.getProduceTime() == null : this.getProduceTime().equals(other.getProduceTime()))
            && (this.getReceiverAddress() == null ? other.getReceiverAddress() == null : this.getReceiverAddress().equals(other.getReceiverAddress()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDrugName() == null) ? 0 : getDrugName().hashCode());
        result = prime * result + ((getDrugType() == null) ? 0 : getDrugType().hashCode());
        result = prime * result + ((getDrugForm() == null) ? 0 : getDrugForm().hashCode());
        result = prime * result + ((getDrugSpec() == null) ? 0 : getDrugSpec().hashCode());
        result = prime * result + ((getDrugUnit() == null) ? 0 : getDrugUnit().hashCode());
        result = prime * result + ((getManufacturerId() == null) ? 0 : getManufacturerId().hashCode());
        result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
        result = prime * result + ((getProduceTime() == null) ? 0 : getProduceTime().hashCode());
        result = prime * result + ((getReceiverAddress() == null) ? 0 : getReceiverAddress().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", drugName=").append(drugName);
        sb.append(", drugType=").append(drugType);
        sb.append(", drugForm=").append(drugForm);
        sb.append(", drugSpec=").append(drugSpec);
        sb.append(", drugUnit=").append(drugUnit);
        sb.append(", manufacturerId=").append(manufacturerId);
        sb.append(", expireTime=").append(expireTime);
        sb.append(", produceTime=").append(produceTime);
        sb.append(", receiverAddress=").append(receiverAddress);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}